home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / news / inn1.000 / inn1.4sec-linux-src.tar / inn / MakeInews < prev    next >
Text File  |  1993-01-29  |  3KB  |  118 lines

  1. #! /bin/sh
  2. ##  $Revision: 1.10 $
  3. ##  Script to build an easy-to-ship single directory that contains
  4. ##  everything needed to build inews on a machine.
  5.  
  6. ##  Optional first argument is the destination architecture, like "sun4"
  7. DIR=inews.${1-dist}
  8. if [ -d ${DIR} ] ; then
  9.     echo ${DIR} exists!
  10.     exit 1
  11. fi
  12. mkdir ${DIR}
  13.  
  14. ##  Copy the files.
  15. for I in \
  16.     config/subst.c config/subst.sh config/config.data \
  17.     doc/distrib.pats.5 doc/inews.1 doc/inn.conf.5 \
  18.     doc/moderators.5 \
  19.     frontends/inews.c \
  20.     include/clibrary.h include/configdata.h include/libinn.h \
  21.     include/macros.h include/mystring.h include/mymemory.h \
  22.     include/nntp.h include/paths.h \
  23.     lib/cleanfrom.c lib/clientactive.c lib/defdist.c lib/genid.c \
  24.     lib/getconfig.c lib/parsedate.y lib/getfqdn.c lib/getmodaddr.c \
  25.     lib/gettime.c lib/localopen.c lib/radix32.c lib/readin.c \
  26.     lib/remopen.c lib/sendarticle.c lib/sendpass.c lib/strerror.c \
  27.     lib/wildmat.c lib/xfopena.c lib/xmemerr.c lib/xmalloc.c lib/xrealloc.c \
  28.     site/distrib.pats site/inn.conf site/moderators site/passwd.nntp ; do \
  29.     cp $I ${DIR}
  30. done
  31.  
  32. ##  Write the Makefile.  We duplicate the RCS revision string of the
  33. ##  script into the Makefile on purpose.
  34. cat <<\EOF >${DIR}/Makefile
  35. ##  $Revision: 1.10 $
  36. SHELL    = /bin/sh
  37. MAKE    = make
  38.  
  39. ##  Configuration dependencies -- edit as appropriate
  40. DEFS    =
  41. CFLAGS    = $(DEFS) -g
  42. LDFLAGS    = -Bstatic
  43. LINTFLAGS=-b -h $(DEFS)
  44.  
  45. ##  Manual pages -- install as appropriate for your system
  46. DOC    = distrib.pats.5 inews.1 moderators.5 inn.conf.5
  47.  
  48. ##  Configuration files -- install in /usr/lib/news
  49. CONF    = distrib.pats inn.conf moderators passwd.nntp
  50.  
  51. ##  Program sources.
  52. HEADERS    = \
  53.     clibrary.h configdata.h libinn.h macros.h nntp.h paths.h
  54. SOURCES    = \
  55.     cleanfrom.c clientactive.c defdist.c genid.c getconfig.c getfqdn.c \
  56.     getmodaddr.c gettime.c localopen.c parsedate.c radix32.c readin.c \
  57.     remopen.c sendarticle.c sendpass.c strerror.c wildmat.c xfopena.c \
  58.     xmalloc.c xmemerr.c xrealloc.c
  59.  
  60. OBJECTS    = \
  61.     cleanfrom.o clientactive.o defdist.o genid.o getconfig.o getfqdn.o \
  62.     getmodaddr.o gettime.o localopen.o parsedate.o radix32.o readin.o \
  63.     remopen.o sendarticle.o sendpass.o strerror.o wildmat.o xfopena.o \
  64.     xmalloc.o xmemerr.o xrealloc.o
  65.  
  66. ##  First target, just compile everything.
  67. all:        inews $(DOC) $(CONF)
  68.     date >all
  69.  
  70. ##  Edit these lines as appropriate for your system
  71. install:    all
  72.     cp inews /usr/lib/news/inews
  73.     cp $(CONF) /usr/lib/news
  74.     cp inews.1 /usr/man/man1
  75.     cp moderators.5 /usr/man/man5
  76.     cp inn.conf.5 /usr/man/man5
  77.  
  78. ##  Clean up, remove non-essentials.
  79. clobber clean:
  80.     rm -f inews core tags lint a.out *.o
  81.     rm -f parsedate.c
  82.  
  83. lint:           inews
  84.     lint $(LINTFLAGS) inews.c $(SOURCES) >lint
  85.  
  86. inews:        inews.o $(OBJECTS)
  87.     rm -f inews
  88.     $(CC) $(LDFLAGS) -o inews $(CFLAGS) inews.o $(OBJECTS)
  89.  
  90. parsedate.c:              parsedate.y
  91.     @echo Expect 6 shift/reduce conflicts
  92.     $(YACC) parsedate.y
  93.     @mv y.tab.c parsedate.c
  94.  
  95. subst:        subst.c subst.sh
  96.     make c || make sh || { rm -f subst ; echo Failed 1>&2 ; }
  97.  
  98. config:        subst config.data $(DOC) $(HEADERS) Makefile
  99.     ./subst -f config.data $(DOC) $(HEADERS) Makefile
  100.     date >config
  101.  
  102. c:
  103.     @rm -f subst
  104.     $(CC) -o subst subst.c
  105. sh:
  106.     @rm -f subst
  107.     cp subst.sh subst
  108.     chmod +x subst
  109.  
  110. ##  Dependencies.  Default list, below, is probably good enough.
  111. depend:         Makefile $(SOURCES)
  112.     makedepend $(DEFS) $(SOURCES)
  113.  
  114. # DO NOT DELETE THIS LINE -- make depend depends on it.
  115. $(OBJECTS):    $(HEADERS)
  116. inews.o:    $(HEADERS)
  117. EOF
  118.